home *** CD-ROM | disk | FTP | other *** search
- ===========================================================================
- BBS: The Abacus * HST/DS * Potterville, MI
- Date: 05-15-93 (17:04) Number: 129
- From: DANNY MATHEWS Refer#: NONE
- To: ALL Recvd: NO
- Subj: <string.h> 1/2 Conf: (36) C Language
- ---------------------------------------------------------------------------
- I wrote a program(pm.c) that generates a text report on equipment that is due
- for preventative maintanance. What the program does is read from a file
- misti.dat to get the mach/entity status. Then it reads from a file called
- module.dat to see if the mach/entity is in the list; if so, get a description
- of the machine. My problem started when I tried to add a date function. That
- is when I noticed I was using some string functions in the program pm.c but
- had not included <string.h>. Do I need <string.h>?
-
- r = strcmp(entity,mach);
-
- if (r == 0) {
- len = strxfrm(target,descript,30);
- strxfrm(target,descript,len);
- fprintf(fout," %-7s %-25s %5s %-13s %7s"
- ,mach,target,state,pm,pm_date);
- fprintf(fout,"\n");
-
-
- Now r = -29 instead of r = 0 when using <string.h>.
- A sample of the text files and source code I was using for debugging
- follows.
-
- I am still tying to figure it out. Do I leave <sting.h> out?
-
- The program, with the date functions work fine without <string.h>?????
-
- Any help, hints and constructive criticism would be appreciated.
-
- danny
-
- misti.dat
- AD101 16 931110 Annual
- AD101 16 930511 Semi-Annual
- AD101 16 930722 Quarterly
- WS101 16 940118 Annual
- WS101 16 930717 Semi-Annual
- WS101 16 930726 Quarterly
- WS101 16 930527 Monthly
- WG302 00 940228 Annual
- WG302 00 930829 Semi-Annual
- WG302 00 930531 Quarterly
- WO302 16 940301 Annual
- WO302 16 930830 Semi-Annual
- WO302 16 930601 Quarterly
-
- module.dat
- AD101 GATE CLEAN
- WS101 GATE HOOD
- WG101 SMS GATE HOOD
- WG302 SMS GATE HOOD
- WG303 SMS GATE HOOD
- WO101 SMS OZONE HOOD
- WO302 SMS OZONE HOOD
- WO303 SMS OZONE HOOD
- WO304 SMS OZONE HOOD
-
- pm.rpt(output file)
- AD101 GATE CLEAN 16 Annual 931110
- AD101 GATE CLEAN 16 Semi-Annual 930511
- AD101 GATE CLEAN 16 Quarterly 930722
- ...
- ...
-
- WS101 GATE HOOD 16 Annual 940118
- WS101 GATE HOOD 16 Quarterly 930601
- WS101 GATE HOOD 16 Quarterly 930601
- (continued in next message)
-
- ... OFFLINE 1.52 "IF %COMMERCIAL == BLADDER.FUL GOTO BATHROOM.NOW"
-
- --- Maximus 2.01wb
- * Origin: The MOCHINE BBS * Irving, TX * 214/399-8414 * HST DS * (1:124/1301)
- SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1
- SEEN-BY: 153/752 154/40 77 157/2 159/100 125 575 950 203/23 209/209 261/1023
- SEEN-BY: 280/1 390/1 396/1 5 15 2270/1 2440/5 3603/20
-